Import mazeScreen
Import bonusShootScreen
Import bonusOddEvensScreen
Import bonusSequenceScreen
Import bonusCountingScreen
Import introScreen
Import titleScreen
Import angelfont
Import speechBubble
Import messageWindow
Import fontmachine
Import mainMenuScreen
Import setDifficultyScreen
Import setLevelScreen

Global _model:Model

Class Model
public
	Const DIFFICULTY_EASY:Int = 0
	Const DIFFICULTY_MEDIUM:Int = 1
	Const DIFFICULTY_HARD:Int = 2
	Const DIFFICULTY_GENIUS:Int = 3
	Const DIFFICULTY_CUSTOM:Int = 4
	
	Const GAME_MODE_UNKNOWN:Int = 0
	Const GAME_MODE_MAIN:Int = 5
	Const GAME_MODE_BONUS_SEQUENCE:Int = 1
	Const GAME_MODE_BONUS_ODD_EVEN:Int = 2
	Const GAME_MODE_BONUS_SHOOT:Int = 3
	Const GAME_MODE_BONUS_COUNTING:Int = 4

	Field gameMode:Int = GAME_MODE_UNKNOWN
	
	Field _titleScreen:TitleScreen
	Field _mazeScreen:MazeScreen
	Field _bonusShootScreen:BonusShootScreen
	Field _bonusOddEvensScreen:BonusOddEvensScreen
	Field _bonusSequenceScreen:BonusSequenceScreen
	Field _bonusCountingScreen:BonusCountingScreen
	Field _mainMenuScreen:MainMenuScreen
	Field _setLevelScreen:SetLevelScreen
	Field _introScreen:IntroScreen
	Field _setDifficultyScreen:SetDifficultyScreen
	Field MAP_WIDTH:Int
	Field MAP_HEIGHT:Int
	Field bonusGameFailed:Bool = False
	Field bonusGameSuccess:Bool = False
	Field zoom:Float = 0.8
	Field font:AngelFont
	Field screenX:Float
	Field screenY:Float
	Field fpsCounter:FPSCounter
	
	Field currentDifficulty:Int = DIFFICULTY_EASY
	
	Field maxStars:Int = 10
	Field stars:Int=0
	Field collectables:Int=0
	Field score:Int=0
	Field moves:Int = 0
	Field messageWindow:MessageWindow
	Field numbersFont:BitmapFont
	
	Method New()
Print "****** NEW MODEL ****************"	
		_model = self
		
		MAP_WIDTH = 1200
		MAP_HEIGHT = 1200
		
		font = New AngelFont()
		font.italicSkew = 0.15
		font.LoadFont("angel3")
		numbersFont = New BitmapFont("tahoma_32.txt")
		Seed = Millisecs()
			
		LoadImages()
		
		
		messageWindow = new MessageWindow()
		_titleScreen = New TitleScreen
	'	_mazeScreen = New MazeScreen
		_introScreen = New IntroScreen
		_model._mazeScreen = New MazeScreen
		_model._bonusSequenceScreen = New BonusSequenceScreen()
		_model._bonusOddEvensScreen = New BonusOddEvensScreen()
		_model._bonusShootScreen = New BonusShootScreen()	
		_model._bonusCountingScreen = New BonusCountingScreen()
		_model._mainMenuScreen = New MainMenuScreen()
		_model._setDifficultyScreen = New SetDifficultyScreen()
		_model._setLevelScreen = New SetLevelScreen()
		
	End

	'***********************
	'* Load Images
	'***********************
	Method LoadImages:Void()
		' create tmpImage for animations
		Local tmpImage:Image
		Local tmpImage2:Image

		game.images.LoadAnim("mapstrip.png", 100, 100,12, tmpImage)
		'game.images.LoadAnim("map1.png", 101, 80,144, tmpImage)
		game.images.Load("map1.png")
		game.images.Load("SpeechBubble.png")

		
		game.images.LoadAnim("numbersStrip.png", 60,60,19, tmpImage)
		game.images.Load("status.png")
				
		game.images.Load("collectStar.png")
		game.images.Load("glow-1.png")
		game.images.Load("ballon1.png")
		game.images.Load("spark.png")
		game.images.Load("16CircleOrange.png")
		game.images.Load("Selector.png")
		
		game.images.Load("Princess.png")
		game.images.Load("bonusBounceBG.png")
		game.images.Load("bonusShootBG.png")
		game.images.Load("yellowGuy.png")
		game.images.Load("scoreBar.png")
		game.images.Load("eyeball.png")
		game.images.Load("alienGuy.png")
		game.images.Load("Star.png")
		game.images.Load("Gem Orange.png")
		game.images.LoadAnim("ButtonStrip.png", 100,100,2, tmpImage)
		
		game.images.Load("wrong.png")
		game.images.Load("right.png")
		
		game.images.Load("Bonus x.png")
		game.images.Load("Bonus div.png")
	End
	
	Method addStar:void()
		stars+=1
	End
End




















